#include <iostream>

class csum
{
	public:
	int add(int a, int b)
	{
		return (a + b);
	}

	int sub(int a, int b)
	{
		return (a - b);
	}
};

int main()
{
	csum *pcsum = new csum;
	csum cs;

	pcsum->add(1, 2);
	pcsum->sub(3, 1);

	cs.add(11, 22);
	cs.sub(33, 11);

	return 0;
}

#if 0

/*
 * intel
 */
00000000000011a9 <main>:
    11a9:	f3 0f 1e fa          	endbr64 
    11ad:	55                   	push   %rbp
    11ae:	48 89 e5             	mov    %rsp,%rbp
    11b1:	48 83 ec 20          	sub    $0x20,%rsp
    11b5:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax
    11bc:	00 00 
    11be:	48 89 45 f8          	mov    %rax,-0x8(%rbp)
    11c2:	31 c0                	xor    %eax,%eax
    11c4:	bf 01 00 00 00       	mov    $0x1,%edi	// edi=0x1
    11c9:	e8 c2 fe ff ff       	callq  1090 <_Znwm@plt>	// new
    11ce:	48 89 45 f0          	mov    %rax,-0x10(%rbp)	// (rbp-0x10)=rax
    11d2:	48 8b 45 f0          	mov    -0x10(%rbp),%rax	// rax=(rbp-0x10)
    11d6:	ba 02 00 00 00       	mov    $0x2,%edx	// edx=0x2
    11db:	be 01 00 00 00       	mov    $0x1,%esi	// esi=0x1
    11e0:	48 89 c7             	mov    %rax,%rdi	// rdi=rax
    11e3:	e8 c4 00 00 00       	callq  12ac <_ZN4csum3addEii>	// add()
    11e8:	48 8b 45 f0          	mov    -0x10(%rbp),%rax	// rax=(rbp-0x10)
    11ec:	ba 01 00 00 00       	mov    $0x1,%edx	// edx=0x1
    11f1:	be 03 00 00 00       	mov    $0x3,%esi	// esi=0x3
    11f6:	48 89 c7             	mov    %rax,%rdi	// rdi=rax
    11f9:	e8 ca 00 00 00       	callq  12c8 <_ZN4csum3subEii>	// sub()
    11fe:	48 8d 45 ef          	lea    -0x11(%rbp),%rax	// rax=(rbp-0x11)
    1202:	ba 16 00 00 00       	mov    $0x16,%edx	// edx=0x16
    1207:	be 0b 00 00 00       	mov    $0xb,%esi	// esi=0xb
    120c:	48 89 c7             	mov    %rax,%rdi	// rdi=rax
    120f:	e8 98 00 00 00       	callq  12ac <_ZN4csum3addEii>	// add()
    1214:	48 8d 45 ef          	lea    -0x11(%rbp),%rax	// rax=(rbp-0x11)
    1218:	ba 0b 00 00 00       	mov    $0xb,%edx	// edx=0xb
    121d:	be 21 00 00 00       	mov    $0x21,%esi	// esi=0x21
    1222:	48 89 c7             	mov    %rax,%rdi	// rdi=rax
    1225:	e8 9e 00 00 00       	callq  12c8 <_ZN4csum3subEii>	// sub()
    122a:	b8 00 00 00 00       	mov    $0x0,%eax	// eax=0
    122f:	48 8b 4d f8          	mov    -0x8(%rbp),%rcx	// rcx=(rbp-0x8)
    1233:	64 48 33 0c 25 28 00 	xor    %fs:0x28,%rcx
    123a:	00 00 
    123c:	74 05                	je     1243 <main+0x9a>
    123e:	e8 5d fe ff ff       	callq  10a0 <__stack_chk_fail@plt>
    1243:	c9                   	leaveq 
    1244:	c3                   	retq   

00000000000012ac <_ZN4csum3addEii>:
    12ac:	f3 0f 1e fa          	endbr64 
    12b0:	55                   	push   %rbp
    12b1:	48 89 e5             	mov    %rsp,%rbp
    12b4:	48 89 7d f8          	mov    %rdi,-0x8(%rbp)	// (rbp-0x8)=rdi
    12b8:	89 75 f4             	mov    %esi,-0xc(%rbp)	// (rbp-0xc)=esi
    12bb:	89 55 f0             	mov    %edx,-0x10(%rbp)	// (rbp-0x10)=edx
    12be:	8b 55 f4             	mov    -0xc(%rbp),%edx	// edx=(rbp-0xc)
    12c1:	8b 45 f0             	mov    -0x10(%rbp),%eax	// eax=(rbp-0x10)
    12c4:	01 d0                	add    %edx,%eax	// eax+=edx
    12c6:	5d                   	pop    %rbp
    12c7:	c3                   	retq   

00000000000012c8 <_ZN4csum3subEii>:
    12c8:	f3 0f 1e fa          	endbr64 
    12cc:	55                   	push   %rbp
    12cd:	48 89 e5             	mov    %rsp,%rbp
    12d0:	48 89 7d f8          	mov    %rdi,-0x8(%rbp)	// (rbp-0x8)=rdi
    12d4:	89 75 f4             	mov    %esi,-0xc(%rbp)	// (rbp-0xc)=esi
    12d7:	89 55 f0             	mov    %edx,-0x10(%rbp)	// (rbp-0x10)=edx
    12da:	8b 45 f4             	mov    -0xc(%rbp),%eax	// eax=(rbp-0xc)
    12dd:	2b 45 f0             	sub    -0x10(%rbp),%eax	// eax=(rbp-0x10)
    12e0:	5d                   	pop    %rbp
    12e1:	c3                   	retq   
    12e2:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
    12e9:	00 00 00 
    12ec:	0f 1f 40 00          	nopl   0x0(%rax)

/*
 * arm
 */
000000000040076c <main>:
  40076c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400770:	910003fd 	mov	x29, sp
  400774:	d2800020 	mov	x0, #0x1                   	// #1
  400778:	97ffffba 	bl	400660 <_Znwm@plt>	// new(1)
  40077c:	f9000fa0 	str	x0, [x29, #24]		// [x29+24]=x0
  400780:	52800042 	mov	w2, #0x2                   	// #2
  400784:	52800021 	mov	w1, #0x1                   	// #1
  400788:	f9400fa0 	ldr	x0, [x29, #24]		// x0=[x29+24]
  40078c:	9400002f 	bl	400848 <_ZN4csum3addEii>
  400790:	52800022 	mov	w2, #0x1                   	// #1
  400794:	52800061 	mov	w1, #0x3                   	// #3
  400798:	f9400fa0 	ldr	x0, [x29, #24]		// x0=[x29+24]
  40079c:	94000034 	bl	40086c <_ZN4csum3subEii>
  4007a0:	910043a0 	add	x0, x29, #0x10
  4007a4:	528002c2 	mov	w2, #0x16                  	// #22
  4007a8:	52800161 	mov	w1, #0xb                   	// #11
  4007ac:	94000027 	bl	400848 <_ZN4csum3addEii>
  4007b0:	910043a0 	add	x0, x29, #0x10
  4007b4:	52800162 	mov	w2, #0xb                   	// #11
  4007b8:	52800421 	mov	w1, #0x21                  	// #33
  4007bc:	9400002c 	bl	40086c <_ZN4csum3subEii>
  4007c0:	52800000 	mov	w0, #0x0                   	// #0
  4007c4:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4007c8:	d65f03c0 	ret

0000000000400848 <_ZN4csum3addEii>:
  400848:	d10043ff 	sub	sp, sp, #0x10
  40084c:	f90007e0 	str	x0, [sp, #8]		// [sp+8]=x0
  400850:	b90007e1 	str	w1, [sp, #4]		// [sp+4]=w1
  400854:	b90003e2 	str	w2, [sp]		// [sp]=w2
  400858:	b94007e1 	ldr	w1, [sp, #4]		// w1=[sp+4]
  40085c:	b94003e0 	ldr	w0, [sp]		// w0=[sp]
  400860:	0b000020 	add	w0, w1, w0		// w0=w1+w0
  400864:	910043ff 	add	sp, sp, #0x10
  400868:	d65f03c0 	ret

000000000040086c <_ZN4csum3subEii>:
  40086c:	d10043ff 	sub	sp, sp, #0x10
  400870:	f90007e0 	str	x0, [sp, #8]	// [sp+8]=x0
  400874:	b90007e1 	str	w1, [sp, #4]	// [sp+4]=w1
  400878:	b90003e2 	str	w2, [sp]	// [sp]=w2
  40087c:	b94007e1 	ldr	w1, [sp, #4]	// [sp+4]=w1
  400880:	b94003e0 	ldr	w0, [sp]	// w0=[sp]
  400884:	4b000020 	sub	w0, w1, w0	// w0=w1-w0
  400888:	910043ff 	add	sp, sp, #0x10
  40088c:	d65f03c0 	ret

#endif
